package API.DAY9.lambda;

public class LambdaDemo3 {
    public static void main(String[] args) {
        Shop shop = new Shop();
        //1
//        Runnable r = new Runnable() {
//            @Override
//            public void run() {
//                shop.buy();
//            }
//        };
        //2
//        Runnable r = ()->shop.buy();
        //3
//        Runnable r = shop::buy;
        //调用成员方法 对象：方法名
        new Thread(shop::buy).start();
        //调用静态方法 类名：方法名
        new Thread(Shop::dosome).start();
    }
}
class Shop{
    public static void dosome(){
        System.out.println("买买买");
    }
    public void buy(){
        System.out.println("买买买");
    }
}
